SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE FUNCTION [dbo].[SP_USUARIO]  (@USERNAME VARCHAR(15))
RETURNS int
AS
BEGIN
   DECLARE @USERID AS INT
   SELECT @USERID=IDUSUARIO FROM TB_USUARIOS WHERE NTUSER = @USERNAME
   RETURN(@USERID)
END


GO
GRANT EXECUTE ON  [dbo].[SP_USUARIO] TO [public]
GO
